<template>
  <div>
    <div><h1 style="color: #26b8a4"></h1></div>
      <div id="classmateView" class="classmateView"></div>

          <td>
            <div>
                  <el-form :inline="true" :model="formInlineclass" class="demo-form-inline">
              <el-form-item>
               <el-button type="primary" @click="onSubmit_clazz();" icon="el-icon-search">点击查看班级信息</el-button>
              </el-form-item>
            </el-form>
          </div>
          </td>

                                              
 

    <el-divider><i class="el-icon-school"></i></el-divider>
      <div class="TeaMain">
      <el-table  stripe border :data="student" style="width: 97%" v-loading="loading">
        <el-table-column prop="name" label="姓名">
        </el-table-column>
        <el-table-column prop="id" label="学号">
        </el-table-column>
        <el-table-column prop="clazz" label="班级">
        </el-table-column>
        <el-table-column prop="room" label="宿舍号">
        </el-table-column>
        <el-table-column prop="height" label="身高">
        </el-table-column>
        <el-table-column prop="weight" label="体重">
        </el-table-column>
        <el-table-column prop="mileageTerm1" label="跑步数1">
        </el-table-column>
        <el-table-column prop="mileageTerm2" label="跑步数2">
        </el-table-column>
        <el-table-column prop="mileageTerm3" label="跑步数3">
        </el-table-column>
        <el-table-column prop="mileageTerm4" label="跑步数4">
        </el-table-column>
      </el-table>
      </div>



  </div>
</template>


<script>
import {Liquid} from '@antv/g2plot';

export default {
  name: "classmateView",
  data() {
    return {
      user: JSON.parse(window.sessionStorage.getItem("user")),
      formInlineclass: {
        clazz: ''
      },
      student: [],
      loading: false
    }
  },


  methods: {
   
    onSubmit_clazz() {
      this.getRequest('/clazz/' + this.user.clazz, {}).then(resp => {
        if (resp) {
          this.student = resp;
        }
      })
    }
  },
}
</script>


<style scoped>
.TeaMain {
  margin-top: 5px;
}
.clazzV {
  margin-top: 5px;
}
body {
  margin: 0;
}
</style>